# -*- coding:utf-8 -*-
__author__ = 'shuxin'
__date__ = '2020/6/13  15:45'

from django.http import HttpResponse
from django.views import View
import untangle


class GnPreciseOrderExportView(View):
    def post(self, request):
        with open("precise_order_export", "r", encoding='utf-8') as fp:
            body = fp.read()
            obj = untangle.parse('precise_order_export')
            order = obj.result.order
            flight = order.flight
            passenger = order.passenger
            print('order', order)
            print('flight', flight)
            print('passenger', passenger)

        return HttpResponse(body, content_type="text/xml")
